import request from '@/utils/request';

// 查询商品货品列表
export function listProduct(query) {
	return request({
		url: '/mall/product/list',
		method: 'post',
		data: query,
	});
}

// 查询商品货品详细
export function getProduct(id) {
	return request({
		url: '/mall/product/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增商品货品
export function addProduct(data) {
	return request({
		url: '/mall/product/add',
		method: 'post',
		data: data,
	});
}

// 编辑商品货品
export function updateProduct(data) {
	return request({
		url: '/mall/product/edit',
		method: 'post',
		data: data,
	});
}

// 删除商品货品
export function delProduct(id) {
	return request({
		url: '/mall/product/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出商品货品
export function exportProduct(query) {
	return request({
		url: '/mall/product/export',
		method: 'post',
		params: query,
	});
}
